<?php

namespace IDock\Insurance\QHIC\Request;

use IDock\Insurance\QHIC\Request\AllQHICRequest;
use IDock\Insurance\QHIC\Response\ProposalStatusResponse;
use IDock\Visitor\ProposalStatusVisitor;

class ProposalStatusRequest extends AllQHICRequest
{
    public $requestType = 'VHL0008';

    protected $response = ProposalStatusResponse::class;

    protected $urlTip = '核保结果查询';

    /*** @var  ProposalStatusVisitor $visitor */
    protected $visitor;

    public function generate(): array
    {
        $arr = [];
        if(!empty($this->visitor->ciInquiryNo)){
            $arr[] = $this->visitor->ciInquiryNo;
        }
        if(!empty($this->visitor->biInquiryNo)){
            $arr[] = $this->visitor->biInquiryNo;
        }
        $list = ['CAppNoList' => []];
        foreach ($arr as $value){
            $list['CAppNoList'][] = ['CAppNo'=>$value];
        }
        return $list;
    }
}
